<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.list.DingDanPeiSongMingXi"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 100%;
        }
        div.tablediv {
            width: 920px;
            margin: auto;
            margin-top: 20px;
            margin-bottom: 20px;
            border-top: 1px solid #cecece;
        }
        td.ui-sgcollapsed.sgexpanded>div, td.ui-sgcollapsed.sgcollapsed>div {
            width: 20px !important;
        }
        tr.ui-subgrid>td.subgrid-data {
            border-right: 1px solid #cecece;
            border-bottom: 1px solid #cecece;
        }
        div.tablediv div.ui-jqgrid-bdiv, div.tablediv div.ui-jqgrid-hdiv {
            border-right: 0px none;
            border-bottom: 0px none;
        }
        span.addRow {
            width: 20px;
            display: block;
            margin: auto;
            cursor: pointer;
        }
        td.subgrid-data {
            background-color: #FDF5E6;
        }
        div.tablediv {
            border-right: 1px solid #cecece;
            border-bottom: 1px solid #cecece;
        }
        .text-left{
            color:#949494;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">     
     <section class="content" >
        <form id="form" class="form-horizontal"  method="post">
            <input type="hidden" name=orderPackId value="${orderPackId}" />
            <table class="infoBox" style="margin-top:5px">
              <tr>
              <td width="150px" calss="infoBoxleft" style="background:url(${ctx}/lib/img/img.png) no-repeat 40px 12px" ></td>
          <!--      <td width="120px" class="infoBoxleft">
                    <p style="color:#fff;font-size:20px;text-align:center;font-weight:600">订单信息</p>
               </td> -->
               <td>
                <div class="box-body" style="background:url(${ctx}/lib/img/infobg.png) no-repeat bottom right;">   
                  <div class="form-group form-group-xs"  style="margin-top:2px;">
                    <label class="col-sm-2 text-right" for="inputTextAlter1"><spring:message code="message.listForm.DingDanBaoHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" >${orderPackId}</div>
                    <label class="col-sm-2 text-right" for="inputTextAlter2"><spring:message code="message.lable.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" id="hospName">${orderPack.hospName}</div>
                  </div>  
                   <div class="form-group form-group-xs"  style="margin-top:-13px;">
                    <label class="col-sm-2 text-right" for="inputTextAlter1"><spring:message code="message.listForm.YiLiaoJiGouDiQu"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" id="areaName">${orderPack.hospArFullname}</div>
                    <label class="col-sm-2 text-right" for="inputTextAlter2"><spring:message code="message.listForm.CaiGouShiJian"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" id="submitDateTime">${orderPack.submitDatetime}</div>
                  </div>  
                  <div class="form-group form-group-xs" style="margin-top:-13px;">                    
                    <label class="col-sm-2 text-right" for="recpUser"><spring:message code="message.listForm.ShouHuoRen"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" id="recpUser">${orderPack.recpUser}</div>
                    <label class="col-sm-2 text-right" for="recpUserPhone"><spring:message code="message.lable.ShouHuoRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-4 text-left" id="recpUserPhone">${orderPack.recpUserphone}</div>
                </div>
                <div class="form-group form-group-xs" style="margin-top:-13px;margin-bottom:0px;">                    
                    <label class="col-sm-2 text-right" for="recpAddr"><spring:message code="message.listForm.ShouHuoDiZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-9 text-left" id="recpAddr">${orderPack.recpAddr}</div>
                </div>
             </div>
       
        </td>
      </tr>
      </table>
        </form>
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugName" name="drugName" placeholder="<spring:message code="message.listForm.tongYongMing"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    <div class="textalign1"><spring:message code="message.listForm.ShengChanQiYe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                         <input type="text" class="textinput" id="prodComp" name="prodComp"  placeholder="<spring:message code="message.listForm.ShengChanQiYe"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    <div class="textalign1" >  
                   <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"  id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
   $(function () {
       //绑定回车
       $('#drugName,#drugCode,#prodComp').bind('keydown', function(event) {
           if (event.keyCode == "13") {
               $('#selectDicCompType').click();
           }
       });  
     
       $("#drugName").focus();//加载页面光标在第一个查询框内
       
       $("#gridlist").jqGrid({
           url: "${ctx}/purOrderInfo/getOrderDetailByComp.html",
           mtype: "POST",
           postData:{"orderPackId":"${orderPackId}"},
           datatype: "json",
           autowidth: true,
          	// shrinkToFit: false,
           height: 255,
           colNames: [
                'orderCode',
                '<spring:message code="message.listForm.CaiGouJia"/>',
                '<spring:message code="message.listForm.CaiGouShuLiang"/>',
                '<spring:message code="message.listForm.CaiGouJinE"/>',
                '<spring:message code="message.listForm.tongYongMing"/>', 
                '<spring:message code="message.listForm.jiXing"/>',
                '<spring:message code="message.listForm.guiGe"/>',
                '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
                '<spring:message code="message.listForm.baoZhuangDanWei"/>', 
                '<spring:message code="message.listForm.shengChanQiYe"/>',
                '国药准字',
                '<spring:message code="message.listForm.CaiGouXianJia"/>',
                '最高零售限价',
                'orderStatus',
                'confirmRemark'
            ],
            colModel: [
                { name: 'orderCode', width: 60, align: "right",sortable:false, hidden:true },
                { name: 'proPrice', width: 60, align: "right",sortable:false,
                    formatter:function(cellvalue, options, row){
                        return formatAmount(cellvalue, options, row);
                    }
                },
                { name: 'proCount', width: 60, align: "center",sortable:false},
                { name: 'orderMoney', width: 60, align: "right",sortable:false,
                    formatter:function(cellvalue, options, row){
                        return formatAmount(cellvalue, options, row);
                    }
                },
                { name: 'drugName', width: 140, align: "left" ,sortable:false },
                { name: 'formName', width: 60 , align: "center",sortable:false},
                { name: 'specName', width: 60, align: "center" ,sortable:false},
                { name: 'factor', width: 60, align: "center" ,sortable:false},
                { name: 'unitName', width: 60, align: "center" ,sortable:false},
                { name: 'prodCompname', width: 180, align: "left",sortable:false,
                    formatter:function(cellvalue, options, row){
                        // return compInfoLink(row.prodCompcode, cellvalue, 1);
                        return cellvalue;
                    }
                },
            	{ name: 'drugMedicine', index: 'drugMedicine',width: 100, align: "center", sortable:false},
                { name: 'proPriceLimit', width: 60,align:"right",sortable:false, hidden:true,
                    formatter:function(cellvalue, options, row){
                        return formatAmount(cellvalue, options, row);
                    }
                },
                { name: 'retailPriceLimit', width: 60,align:"right",sortable:false, hidden:true,
                    formatter:function(cellvalue, options, row){
                        return formatAmount(cellvalue, options, row);
                    }
                },
                { name: 'orderStatus', width: 60, align: "center" ,sortable:false, hidden:true},
                { name: 'confirmRemark', width: 60, align: "center" ,sortable:false, hidden:true}
            ],
           rowNum: 20,
           rowList: [10, 20, 50, 100],
           rownumbers: true,
           pager: "#gridpage",
           multiselect: false, 
           viewrecords: true,
           gridComplete: function(){
               //序号列宽度自适应（参数为jqgridID）
               // autoRNWidth("gridlist");
           }, 
           caption: "订单明细列表",
           jsonReader: {
               repeatitems: false,
               id: "orderCode"
           },
       });
       $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
       $(window).trigger("resize");
       
       $("html").scrollTop(305);
   });
   
   //查询
   function gridSerch() {
       var drugCode = $.trim($("#drugCode").val());
       var drugName = $.trim($("#drugName").val());
       var prodComp = $.trim($("#prodComp").val());
       $("#gridlist").jqGrid('setGridParam',{  
           datatype:'json',
           postData:{
               "drugCode":drugCode,
               "drugName":drugName,
               "compName":prodComp
           },
           page:1
       }).trigger("reloadGrid"); //重新载入  
   }
   </script>
        
</body>
</html>
